package com.jt.mapper;

import com.jt.pojo.User;
import com.jt.vo.PageResult;
import org.apache.ibatis.annotations.*;

import java.util.List;
public interface UserMapper {
    @Select("select * from user")
    List<User> findAll();
@Select("select * from user where username=#{username} and password=#{password}")
    User findUP(User user);
@Select("select count(1) from user" )
    long getTotal();

    List<User> finduserByRows(@Param("start") int start,@Param("size") int size,@Param("query") String query);
@Update("update user set status=#{status} ,updated=#{updated} where id=#{id}")
    void updatestatus(User user);
@Insert("insert into user(id,username,password,phone,email,status,created,updated,sex,nickname,age,address,type,time) value(null,#{username},#{password},#{phone},#{email},#{status},#{created},#{updated},#{sex},#{nickname},#{age},#{address},#{type},#{time})")
    void insertuser(User user);
@Select("select * from user where id=#{id}")
    User finduserByid(Integer id);
@Update("update user set phone= #{phone},email=#{email},type=#{type},nickname=#{nickname},sex=#{sex},age=#{age},address=#{address} where id=#{id}")
    void updatedate(User user);
@Delete("delete from user where id=#{id}")
    void deleteuser(Integer id);
//@Select("select * from user limit #{start},#{size}")
//    List<User> finduserByRows(@Param("start") int start,@Param("size") int size);
}
//    参数名称	参数说明	备注
//        ID	用户ID号	不能为null
//        phone	手机信息	不能为null
//        email	邮箱地址	不能为null